﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace Runner
{
    static class Program
    {
        /// <summary>
        /// Главная точка входа для приложения.
        /// </summary>
        [STAThread]
        static void Main(string[] input)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (input.Length == 0)
            {
                Application.Run(new MainForm());
            }
            else
            {
                if (input[0] == "-instrun")
                {
                    ServiceManager sm = new ServiceManager();
                    sm.InstallServ();
                    sm.StartServ();
                    sm.Close();
                    sm = null;
                }
                if (input[0] == "-upd")
                {
                    ServiceManager sm = new ServiceManager();
                    sm.UpdServ();
                    sm.Close();
                    sm = null;
                }
                if (input[0] == "-uninst")
                {
                    ServiceManager sm = new ServiceManager();
                    sm.UninstallServ();
                    sm.Close();
                    sm = null;
                }
                if (input[0] == "-run")
                {
                    ServiceManager sm = new ServiceManager();
                    sm.StartServ();
                    sm.Close();
                    sm = null;
                }
                if (input[0] == "-stop")
                {
                    ServiceManager sm = new ServiceManager();
                    sm.StopServ();
                    sm.Close();
                    sm = null;
                }
                Application.Exit();
            }
        }
    }
}
